<template>
	<div>
		<div style="text-align: center;margin-top: 20px;">
		</div>
		<div>
			<div id="regInfo" class="reg-container">
				<el-form :model="companyInfo" label-width="120px" v-show="regType=='注册'">
					<el-form-item label="姓名">
						<el-input v-model="personInfo.name" required placeholder="请输入姓名"></el-input>
					</el-form-item>
					<el-form-item label="昵称">
						<el-input v-model="personInfo.name" required placeholder="请输入昵称"></el-input>
					</el-form-item>
					<el-form-item label="公司名称">
						<el-input v-model="companyInfo.name" required placeholder="请输入公司名称"></el-input>
					</el-form-item>
					<el-form-item label="手机号">
						<el-input v-model="companyInfo.phone" required placeholder="请输入手机号"></el-input>
					</el-form-item>
					<el-form-item label="联系人">
						<el-input v-model="companyInfo.contact" required placeholder="请输入联系人"></el-input>
					</el-form-item>
					<el-form-item label="密码">
						<el-input v-model="companyInfo.password" required placeholder="请输入密码"></el-input>
					</el-form-item>
					<el-form-item label="确认密码">
						<el-input v-model="companyInfo.confirmPassword" required placeholder="请输入确认密码"></el-input>
					</el-form-item>
					<el-form-item label="手机验证码">
						<el-input v-model="companyInfo.confirmPassword" required placeholder="请输入手机验证码"></el-input>
					</el-form-item>
				</el-form>
				
				<div>
					<el-checkbox v-model="isAgree" label="我已阅读并同意《中国柏特工业品网络服务使用协议》" border style="margin-left: 120px;"></el-checkbox>
				</div>
				<div style="text-align: center;margin-top: 10px;">
					<el-button style="width: 120px;" type="success">注&nbsp;&nbsp;&nbsp;&nbsp;册</el-button>
				</div>
				<div style="text-align: right;margin-top: 10px;">
					<el-button size="mini" round style="color: #0074D9;" @click="regLogin()">已有账号？立即登录</el-button>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				regType: '注册',
				isAgree: true,
				companyInfo: {
					name: "",
					phone: "",
					contact: "",
					password: "",
					confirmPassword: "",
					hacode: "",
				},
				personInfo: {
					name: "",
					phone: "",
					contact: "",
					password: "",
					confirmPassword: "",
					hacode: "",
				}
			};
		},
		methods: {
			regLogin() {
				this.$router.push({
					path: '/login'
				})
			}
		},
	}
</script>

<style>
	#regInfo .el-form-item__label::after ，#regInfo2 .el-form-item__label::after {
		content: "*";
		color: red;
	}

	.reg-container {
		margin: 10px auto;
		width: 60%;
		border: #00AB42 1px solid;
		padding: 25px 20px;
	}
</style>
